import { getBaseOptions } from './service';

const Model = {
  namespace: 'infoModel',
  state: {
    options: {},
  },
  effects: {
    *getBaseOptions({ payload }, { call, put }) {
      const response = yield call(getBaseOptions, payload);
      yield put({
        type: 'setOptions',
        payload: response,
      });
    },
  },
  reducers: {
    setOptions(state, { payload }) {
      return { ...state, options: payload };
    },
  },
};
export default Model;
